#  define a function that outputs multiplication table
def MultiplicationTable(n=1):
    """
    @param n:if n = 1, the function is gonna output multiplication table forward
             if n = 0, the function is gonna output multiplication table backward
             on default, n = 1
    @return: no return value
    """
    if n == 1:
        outOrder = range(1, 10)
    else:
        outOrder = range(9, 0, -1)
    for i in outOrder:
        for j in range(1, i + 1):
            print(f'{i}x{j}={i * j}', end=' ')
        print()


MultiplicationTable()
MultiplicationTable(0)
MultiplicationTable(1)
